import { connection } from '../app/database/mysql'

export const createUserLikePost = async (userId: number, postId: number) => {
  const statement = `INSERT INTO user_like_post (user_id, post_id) VALUES (?,?)`
  const [data] = await connection.promise().query(statement, [userId, postId])
  return data
}

export const deleteUserLikePost = async (userId: number, postId: number) => {
  const statement = `DELETE FROM user_like_post WHERE user_id = ? AND post_id = ?`
  const [data] = await connection.promise().query(statement, [userId, postId])
  return data
}
